package com.pkk.log.web.controller;

import com.pkk.components.rpc.response.CommonResponse;
import com.pkk.components.rpc.response.util.ResponseUtil;
import com.pkk.penguin.support.runner.web.constant.enums.WebMenuTypeEnum;
import com.pkk.penguin.support.runner.web.support.AbstractWebMenuSimpleSupport;
import com.pkk.penguin.support.runner.web.vo.SysMenuSupportVo;
import java.util.ArrayList;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @description: 日志服务系统处理器
 * @author: peikunkun
 * @create: 2019-07-14 00:55
 **/
@Slf4j
@Controller
public class SysLogHandleController extends AbstractWebMenuSimpleSupport {

  /**
   * @Description: 初始化日志菜单
   * @Param: []
   * @return: com.pkk.components.util.response.CommonResponse<java.lang.Object>
   * @Author: peikunkun
   * @Date: 2019/7/14 0014 上午 12:56
   */
  @ResponseBody
  public CommonResponse<Object> initMenu() {
    String str = "{\"msg\":\"success\",\"menuList\":[{\"menuId\":\"116\",\"parentId\":\"0\",\"parentName\":null,\"name\":\"运营数据\",\"url\":null,\"perms\":null,\"type\":0,\"icon\":\"fa fa-folder\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":[{\"menuId\":\"608\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"平台盈亏统计\",\"url\":\"modules/view/incomeAndExpend.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-strikethrough\",\"orderNum\":10,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"700\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"平台盈亏对比\",\"url\":\"modules/view/chargeIncomeCompare.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-themeisle\",\"orderNum\":15,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"609\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"平台用户统计\",\"url\":\"modules/view/platformUserCount.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-sign-language\",\"orderNum\":30,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"610\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"平台用户汇总\",\"url\":\"modules/view/platformUserTotal.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-hand-spock-o\",\"orderNum\":40,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"697\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"平台ip统计\",\"url\":\"modules/view/platformIpCount.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-grav\",\"orderNum\":50,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"707\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"平台ip统计曲线\",\"url\":\"modules/view/platIpCountCharts.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-street-view\",\"orderNum\":55,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"357\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"平台每日汇报\",\"url\":\"modules/view/showData2.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-sort-amount-asc\",\"orderNum\":60,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"607\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"平台每日指标\",\"url\":\"modules/view/platformEveryCout.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-joomla\",\"orderNum\":80,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"415\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"总站IP统计\",\"url\":\"modules/view/allPlatformIpCount.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-microchip\",\"orderNum\":90,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"120\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"单日数据情况\",\"url\":\"modules/view/Platform.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-quora\",\"orderNum\":110,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"117\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"两日对比曲线图\",\"url\":\"modules/view/mainDetails.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-bar-chart\",\"orderNum\":120,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"127\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"全站流量监控\",\"url\":\"modules/view/netraffic.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-line-chart\",\"orderNum\":130,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"611\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"竞价流量监控\",\"url\":\"modules/view/priceNetTraffic.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-life-ring\",\"orderNum\":140,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"134\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"返回键监控\",\"url\":\"modules/view/returns.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-window-close\",\"orderNum\":150,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"329\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"运营数据查询\",\"url\":\"modules/view/dataQuery.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-pencil-square-o\",\"orderNum\":160,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"703\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"按平台分析\",\"url\":\"modules/view/platformCalc.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-birthday-cake\",\"orderNum\":165,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"368\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"二次分享流量监控\",\"url\":\"modules/view/secondShareChart.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-free-code-camp\",\"orderNum\":170,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"138\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"用户行为对比\",\"url\":\"modules/view/contrast.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-cc\",\"orderNum\":175,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"705\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"拉新粗漏斗\",\"url\":\"modules/view/inviteNewUsersCount.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-hourglass-end\",\"orderNum\":177,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"130\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"历史数据查询\",\"url\":\"modules/view/dailyStatistics.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-reddit-alien\",\"orderNum\":180,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"356\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"用户收益占比\",\"url\":\"modules/view/incomeSource.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-industry\",\"orderNum\":190,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"367\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"二次分享阅读\",\"url\":\"modules/view/secondShareCount.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-reply-all\",\"orderNum\":200,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"675\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"文章阅读统计\",\"url\":\"modules/view/articleReadCount.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-fire-extinguisher\",\"orderNum\":300,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"684\",\"parentId\":\"116\",\"parentName\":null,\"name\":\"文章阅读占比\",\"url\":\"modules/view/articlePercent.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-pie-chart\",\"orderNum\":310,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null}]},{\"menuId\":\"362\",\"parentId\":\"0\",\"parentName\":null,\"name\":\"域名数据\",\"url\":null,\"perms\":null,\"type\":0,\"icon\":\"fa fa-ravelry\",\"orderNum\":1,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":[{\"menuId\":\"360\",\"parentId\":\"362\",\"parentName\":null,\"name\":\"线上域名情况\",\"url\":\"modules/view/domaininventory.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-at\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"674\",\"parentId\":\"362\",\"parentName\":null,\"name\":\"被封域名管理\",\"url\":\"modules/view/lockedDomainManage.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-scissors\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"239\",\"parentId\":\"362\",\"parentName\":null,\"name\":\"被封域名分布\",\"url\":\"modules/view/domain.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-newspaper-o\",\"orderNum\":1,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null}]},{\"menuId\":\"363\",\"parentId\":\"0\",\"parentName\":null,\"name\":\"商务数据\",\"url\":null,\"perms\":null,\"type\":0,\"icon\":\"fa fa-briefcase\",\"orderNum\":2,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":[{\"menuId\":\"234\",\"parentId\":\"363\",\"parentName\":null,\"name\":\"商务数据查询\",\"url\":\"modules/view/expend.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-industry\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"235\",\"parentId\":\"363\",\"parentName\":null,\"name\":\"商务周期数据对比\",\"url\":\"modules/view/platUseCompare.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-drupal\",\"orderNum\":1,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"320\",\"parentId\":\"363\",\"parentName\":null,\"name\":\"商务单日数据对比\",\"url\":\"modules/view/useAndIncome.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-align-center\",\"orderNum\":2,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null}]},{\"menuId\":\"233\",\"parentId\":\"0\",\"parentName\":null,\"name\":\"百度统计\",\"url\":null,\"perms\":null,\"type\":0,\"icon\":\"fa fa-bold\",\"orderNum\":3,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":[{\"menuId\":\"361\",\"parentId\":\"233\",\"parentName\":null,\"name\":\"百度移动账号管理\",\"url\":\"modules/view/baiduMobileManage.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-mouse-pointer\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"131\",\"parentId\":\"233\",\"parentName\":null,\"name\":\"百度账号管理\",\"url\":\"modules/view/accountManage.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-address-book\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"132\",\"parentId\":\"233\",\"parentName\":null,\"name\":\"百度站点管理\",\"url\":\"modules/view/websiteManage.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-anchor\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"133\",\"parentId\":\"233\",\"parentName\":null,\"name\":\"站点类型管理\",\"url\":\"modules/view/siteTypeManage.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-bookmark\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"135\",\"parentId\":\"233\",\"parentName\":null,\"name\":\"百度定时任务\",\"url\":\"modules/view/BaiduTiming.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-tasks\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null}]},{\"menuId\":\"121\",\"parentId\":\"0\",\"parentName\":null,\"name\":\"平台管理\",\"url\":null,\"perms\":null,\"type\":0,\"icon\":\"fa fa-codepen\",\"orderNum\":5,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":[{\"menuId\":\"366\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"广告主账号管理\",\"url\":\"modules/view/advertUserAccount.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-street-view\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"122\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"报警邮箱配置\",\"url\":\"modules/view/warningSetting.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-cc-mastercard\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"123\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"APP管理\",\"url\":\"modules/view/platformManage.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-list-ul\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"124\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"报警模板配置\",\"url\":\"modules/view/alarmTemplate.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-dropbox\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"125\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"报警策略配置\",\"url\":\"modules/view/alarmConfig.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-first-order\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"128\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"平台配置管理\",\"url\":\"modules/view/systemCheck.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-assistive-listening-systems\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"129\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"动态表管理\",\"url\":\"modules/view/database.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-table\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"136\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"平台定时任务\",\"url\":\"modules/view/platformTiming.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-thumb-tack\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"137\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"平台用户来源管理\",\"url\":\"modules/view/source.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-user-secret\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"232\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"平台快速开通\",\"url\":\"modules/view/platformSetting.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-etsy\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"238\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"域名类型配置\",\"url\":\"modules/view/domainSiteManage.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-xing\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"328\",\"parentId\":\"121\",\"parentName\":null,\"name\":\"三方数据录入\",\"url\":\"modules/view/entering.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-thumb-tack \",\"orderNum\":10,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null}]},{\"menuId\":\"1\",\"parentId\":\"0\",\"parentName\":null,\"name\":\"系统管理\",\"url\":null,\"perms\":null,\"type\":0,\"icon\":\"fa fa-cog\",\"orderNum\":6,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":[{\"menuId\":\"359\",\"parentId\":\"1\",\"parentName\":null,\"name\":\"数据管理\",\"url\":\"modules/sys/dataInfo.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-database\",\"orderNum\":0,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"31\",\"parentId\":\"1\",\"parentName\":null,\"name\":\"部门管理\",\"url\":\"modules/sys/dept.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-file-code-o\",\"orderNum\":1,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"2\",\"parentId\":\"1\",\"parentName\":null,\"name\":\"管理员管理\",\"url\":\"modules/sys/user.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-user\",\"orderNum\":2,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"3\",\"parentId\":\"1\",\"parentName\":null,\"name\":\"角色管理\",\"url\":\"modules/sys/role.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-user-secret\",\"orderNum\":2,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"4\",\"parentId\":\"1\",\"parentName\":null,\"name\":\"菜单管理\",\"url\":\"modules/sys/menu.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-th-list\",\"orderNum\":3,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"5\",\"parentId\":\"1\",\"parentName\":null,\"name\":\"SQL监控\",\"url\":\"druid/sql.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-bug\",\"orderNum\":4,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"6\",\"parentId\":\"1\",\"parentName\":null,\"name\":\"定时任务\",\"url\":\"modules/job/schedule.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-tasks\",\"orderNum\":5,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null},{\"menuId\":\"36\",\"parentId\":\"1\",\"parentName\":null,\"name\":\"字典管理\",\"url\":\"modules/sys/dict.html\",\"perms\":null,\"type\":1,\"icon\":\"fa fa-bookmark-o\",\"orderNum\":6,\"isDisplay\":1,\"isOpen\":0,\"open\":null,\"list\":null}]}],\"code\":0}";
    return ResponseUtil.success(str);
  }

  /**
   * @Description: 构建菜单
   * @Param: []
   * @return: java.util.List<com.pkk.penguin.support.runner.web.vo.SysMenuSupportVo>
   * @Author: peikunkun
   * @Date: 2019/7/14 0014 下午 12:40
   */
  @Override
  public List<SysMenuSupportVo> buildWebMenu() {
    final ArrayList<SysMenuSupportVo> sysMenuSupportVos = new ArrayList<>();

    //菜单
    final ArrayList<SysMenuSupportVo> childMenuByOne = new ArrayList<>();
    //子菜单
    childMenuByOne.add(
        SysMenuSupportVo.builder().menuId(101L).parentId(1L).name("日志查看").url("modules/log/logViewMannger.html")
            .type(WebMenuTypeEnum.MENU_TYPE_MENU.getType()).build());

    //父菜单
    sysMenuSupportVos.add(SysMenuSupportVo.builder().menuId(1L).parentId(0L).name("日志管理")
        .type(WebMenuTypeEnum.MENU_TYPE_DIRECTORY.getType()).list(childMenuByOne).build());
    return sysMenuSupportVos;
  }
}
